package com.linkoog.devtools.view_remark.persistent;

import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@State(name = "ViewRemarkConfig", storages = @Storage("ApiTest-ViewRemarkConfig.xml"))
public class ViewRemarkConfigPersistent implements PersistentStateComponent<ViewRemarkConfigPersistent> {

    public static ViewRemarkConfigPersistent getInstance(@NotNull Project project) {
        return project.getService(ViewRemarkConfigPersistent.class);
    }

    @Nullable
    @Override
    public ViewRemarkConfigPersistent getState() {
        return this;
    }

    @Override
    public void loadState(@NotNull ViewRemarkConfigPersistent state) {
        this.showAlias = state.showAlias;
        this.showPrefix = state.showPrefix;
        this.showSubfix = state.showSubfix;
    }


    private boolean showAlias = true;
    private boolean showPrefix = true;
    private boolean showSubfix = true;

    public boolean isShowAlias() {
        return showAlias;
    }

    public void setShowAlias(boolean showAlias) {
        this.showAlias = showAlias;
    }

    public boolean isShowPrefix() {
        return showPrefix;
    }

    public void setShowPrefix(boolean showPrefix) {
        this.showPrefix = showPrefix;
    }

    public boolean isShowSubfix() {
        return showSubfix;
    }

    public void setShowSubfix(boolean showSubfix) {
        this.showSubfix = showSubfix;
    }
}
